class UnusualAdd {
public:
    int addAB(int A, int B) {
        int a = A;
        int b = B;
        int tmp;
        int product = 0;
        product = (a ^ b) ^ ((a & b) << 1);

        while (a & b)
        {
            tmp = a ^ b;
            b = (a & b) << 1;
            a = tmp;
            product = (a ^ b) ^ ((a & b) << 1);

        }
        return product;
    }
};